package in.cdacnoida.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;



@WebServlet("/mvc")
public class MVCDemo extends HttpServlet {

	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		String[] names = request.getParameter("names").split("\\|");
		//populating the model [Model is whatever in the attribute]
		request.setAttribute("names", names);
		RequestDispatcher view = request.getRequestDispatcher("jsp/MVC.jsp");	
		view.forward(request, response);
	}
	
	

}
